package cn.roadtrip.utilmodule.util.enumpck;

/**
 * 酒店房型枚举..standar：标间；comfort：舒适；rich：豪华；economic：经济
 */
public enum Enum_HotelRoomType {
    Standar("Standar", "标间"),
    Comfort("Comfort", "舒适"),
    Economic("Economic", "经济"),
    Rich("Rich", "豪华");

    private String s;
    private String title;

    Enum_HotelRoomType(String s, String title) {
        this.s = s;
        this.title = title;
    }

    Enum_HotelRoomType(String s) {
        this.s = s;
        this.title = Enum_HotelRoomType.parseCode(s).getTitle();
    }

    public String getTitle() {
        return this.title;
    }

    public String getCode() {
        return this.s;
    }

    public static final Enum_HotelRoomType parseCode(String code) {
        switch (code) {
            case "Standar":
                return Standar;
            case "Comfort":
                return Comfort;
            case "Rich":
                return Rich;
            case "Economic":
                return Economic;
        }
        return null;
    }

    @Override
    public String toString() {
        return "(code:%s, title:%s)".formatted(this.s, this.title);
    }
}
